<script setup>
import {ref} from 'vue'
  let count = ref(1)
  const emit = defineEmits(['inc', 'dblclick'])

  function doInc(){
    emit('inc', count.value++)
  }

  function doDblClick() {
    emit('dblclick', {
      count: count.value,
      isEven: count.value % 2 === 0
    })
    count.value++
  }
</script>

<template>
  <button @click="doInc">Increment</button>
  <span @click="doDblClick">Count is {{count}}</span>
</template>

<style scoped>

</style>